package com.aizhixin.test.errolAlmost.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.aizhixin.test.errolAlmost.service.timeDifferenService;
import com.aizhixin.test.errolAlmost.vo.openIdVo;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;

@RestController
@RequestMapping(value="/v1/open/timedifferecen")
@Api(tags="时间差API")
@Slf4j

public class timeDiffereceController{
	/*
	 * 输入openid后得到天数
	 */
	@Autowired 
	private timeDifferenService timeDifferenService;
	@GetMapping(value="/{openId}",produces=MediaType.APPLICATION_JSON_VALUE)
	@ApiOperation(httpMethod="GET",value="查看来了app多少天了",notes="查看来app多少天了<br><br><br>@author xixi</b>")
	public Long timedifference(
			@ApiParam(value="openId",required=true)
			@PathVariable String openId) {
		return timeDifferenService.getTimeDifference(openId);
	}
}
